<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')" />
    <link rel="stylesheet" href="../../../../../../../../../../../../css/navigation.css">
</head>
<body class="gray-bg">
<div class="navigation visible-xs-block">
    <ol class="breadcrumb">
        <span> > </span>
        <li><a href="#" onclick="gomain()">主页</a></li>
        <li><a href="#" onclick="oilcard()">车辆用油支出</a></li>
        <li style="color: black">副油卡支出</li>
    </ol>
    <div class="aLine"></div>
</div>
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 100px">副油卡卡号：</label>
                                <input type="text" name="chNumber"/>
                            </li>
<!--                            <li>-->
<!--                                <label>副油卡余额：</label>-->
<!--                                <input type="text" name="chMoney"/>-->
<!--                            </li>-->
                            <li class="select-time">
                                <label>充值时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginChTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endChTime]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script src="../../../../../../../../../../../../js/breadcrumb.js"></script>
    <script th:inline="javascript">
        var prefix = ctx + "ruoyi/childcard";
        $(function() {
            var options = {
                url: prefix + "/list",
                exportUrl: prefix + "/export",
                modalName: "",
                showFooter: true,
                sortName:'chTime',
                sortOrder:'desc',
                striped: true,
                showColumns:false,
                // onExpandRow: function (index, row, $detail) {
                //     initChildTable(index, row, $detail);
                // },
                columns: [
                {
                    field: 'chId', 
                    title: '副油卡id',
                    visible: false
                },
                {
                    field: 'chAffiliation', 
                    title: '归属主卡号',
                    visible: false
                },
                {
                    field: 'chNumber', 
                    title: '副油卡卡号'
                },
                //{
                    // field: 'chMoney',
                    // title: '副油卡余额',
                    // footerFormatter: function(value){
                    //     var sum = 0;
                    //     for (var i in value) {
                    //         sum += parseFloat(value[i].chMoney)
                    //     }
                    //     return "副油卡总花费费用: "+sum;
                    // }
                //},
                    {
                        //field: 'chTopup',
                        title: '副油卡充值金额',
                        sortable: true, //排序
                        formatter:function(value, row, index){
                            var actions = [];
                            actions.push('￥'+row.chTopup);

                            return actions.join('');
                        },
                        footerFormatter: function(value){
                            var sum = 0;
                            for (var i in value) {
                                sum += parseFloat(value[i].chTopup)
                            }
                            return "副油卡总充值费用: ￥"+sum;
                        }
                    },
                {
                    field: 'chTime', 
                    title: '充值时间',
                    sortable: true,
                },
                {
                    field: 'chRemark', 
                    title: '备注'
                }]
            };
            $.table.init(options);
        });
        // initChildTable = function (index, row, $detail) {
        //     var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
        //     $(childTable).bootstrapTable({
        //         url: prefix + "/listsBalance",
        //         // updateUrl: prefix + "/edit/{id}",
        //         method: 'post',
        //         sidePagination: "server",
        //         contentType: "application/x-www-form-urlencoded",
        //         queryParams: {
        //             sName:row.userId
        //         },
        //         columns: [
        //             {
        //                 field: "sId",
        //                 title: '员工工资',
        //                 visible: false
        //             },
        //             {
        //                 //field: 'sMoney',
        //                 title: '员工工资',
        //                 formatter: function(value, row, index) {
        //                     var actions = [];
        //                     actions.push('￥'+row.sMoney);
        //                     return actions.join('');
        //                 }
        //             },
        //             {
        //                 field : 'sDate',
        //                 title : '工资日期'
        //
        //             },
        //             {
        //                 field: 'sStatus',
        //                 title: '下发状态 ',
        //                 formatter: function(value, row, index) {
        //                     return $.table.selectDictLabel(sStatuss, value);
        //                 }
        //             },
        //             {
        //                 //field : 'sBalance',
        //                 title : '下发金额',
        //                 formatter: function(value, row, index) {
        //                     var actions = [];
        //                     if(row.sBalance==null){
        //                         actions.push('￥'+0);
        //                         return actions.join('');
        //                     }else{
        //                         actions.push('￥'+row.sBalance);
        //                         return actions.join('');
        //                     }
        //                 }
        //             },
        //             {
        //                 title: '操作',
        //                 align: 'center',
        //                 formatter: function (value, row, index) {
        //                     var actions = [];
        //                     actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="authRole(\'' + row.sId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
        //                     actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.sId + '\')"><i class="fa fa-search"></i>下发</a> ');
        //                     actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.sId + '\')"><i class="fa fa-remove"></i>删除</a>');
        //                     return actions.join('');
        //                 }
        //             }]
        //     });
        // };
    </script>
</body>
</html>